package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

/**
 * 类功能描述(类上)
 *
 * @author AnBetter
 * @since 2021-04-14
 */
public class AddToWatchLaterCommand implements Sequenceable, Serializable {
    @SerializedName("commandMetadata")
    private CommandMetadata commandMetadata;

    @SerializedName("playlistEditEndpoint")
    private PlaylistEditEndpoint playlistEditEndpoint;

    @SerializedName("clickTrackingParams")
    private String clickTrackingParams;

    public static final Sequenceable.Producer<AddToWatchLaterCommand> CREATOR = new Producer<AddToWatchLaterCommand>() {
        @Override
        public AddToWatchLaterCommand createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            AddToWatchLaterCommand addToWatchLaterCommand = new AddToWatchLaterCommand();
            addToWatchLaterCommand.unmarshalling(parcel);
            return addToWatchLaterCommand;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeSequenceable(this.commandMetadata);
        parcel.writeSequenceable(this.playlistEditEndpoint);
        parcel.writeString(this.clickTrackingParams);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        parcel.readSequenceable(this.commandMetadata);
        parcel.readSequenceable(this.playlistEditEndpoint);
        this.clickTrackingParams=parcel.readString();
        return true;
    }

    @Override
    public String toString() {
        return "AddToWatchLaterCommand{" +
                "commandMetadata = '" + commandMetadata + '\'' +
                ",playlistEditEndpoint = '" + playlistEditEndpoint + '\'' +
                ",clickTrackingParams = '" + clickTrackingParams + '\'' +
                "}";
    }

    public CommandMetadata getCommandMetadata() {
        return commandMetadata;
    }

    public void setCommandMetadata(CommandMetadata commandMetadata) {
        this.commandMetadata = commandMetadata;
    }

    public PlaylistEditEndpoint getPlaylistEditEndpoint() {
        return playlistEditEndpoint;
    }

    public void setPlaylistEditEndpoint(PlaylistEditEndpoint playlistEditEndpoint) {
        this.playlistEditEndpoint = playlistEditEndpoint;
    }

    public String getClickTrackingParams() {
        return clickTrackingParams;
    }

    public void setClickTrackingParams(String clickTrackingParams) {
        this.clickTrackingParams = clickTrackingParams;
    }
}
